package com.example.zhongcao.service;

import com.example.zhongcao.entity.YuLanZhongcao;
import com.example.zhongcao.entity.Zhongcao;
import com.example.zhongcao.entity.ZhongcaoDetails;
import com.example.zhongcao.exception.InvalidParam;
import com.example.zhongcao.exception.User.InvalidOpenid;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public interface ZhongcaoService {
    /**
     *新建种草
     * @param openid openid
     * @param title 种草商品名称
     * @param intro 种草上面描述
     * @param address 地址
     * @param author 作者
     * @param price 价格
     * @param pics 图片
     * @param signs 标签
     * @throws InvalidOpenid openid无效异常
     * @throws InvalidParam 参数错误异常
     */
    public void buildZhongcao(String openid, String title, String intro, String address, String author, String price, List<MultipartFile>pics, List<String> signs) throws Exception;

    /**
     * 获取个人种草预览
     * @param openid openid
     * @param type 类型
     * @param keyword 关键字
     * @return 预览
     */
    public List<YuLanZhongcao> getMyZCs(String openid, String type, String keyword) throws InvalidOpenid, InvalidParam;

    /**
     * 获取种草详情
     * @param zhongcaoid 种草id
     * @return 种草详情
     */
    public ZhongcaoDetails getZhongcaoDeatils(Integer zhongcaoid) throws InvalidParam;

    /**
     * 编辑种草信息
     * @param zc 种草信息
     * @param pics 图片
     * @param signs 标签
     */
    public void editZhongcao(Zhongcao zc,List<MultipartFile> pics,List<String> signs) throws Exception;

    /**
     * 获取社区种草信息预览
     * @param type 类型
     * @param keyword 关键字
     * @param sign 标签
     * @return 社区种草预览
     */
    public List<YuLanZhongcao> getComZCs(String type, String keyword, String sign) throws InvalidParam;

    public void goodZhongcao(Integer zhongcaoid,String openid) throws InvalidOpenid, InvalidParam;
}

